/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('aiearth-engine', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateAIJobRequest {
  app?: string(name='App'),
  areaThreshold?: double(name='AreaThreshold'),
  confidence?: double(name='Confidence'),
  inputs?: [ 
    {
      des?: {
        bandNo?: string(name='BandNo'),
        dataId?: string(name='DataId'),
        type?: string(name='Type'),
        zoomLevel?: int32(name='ZoomLevel'),
      }(name='Des'),
      idx?: int32(name='Idx'),
      src?: {
        bandNo?: string(name='BandNo'),
        dataId?: string(name='DataId'),
        type?: string(name='Type'),
        zoomLevel?: int32(name='ZoomLevel'),
      }(name='Src'),
    }
  ](name='Inputs'),
  jobName?: string(name='JobName'),
  modelProjectId?: long(name='ModelProjectId'),
  modelVersion?: string(name='ModelVersion'),
  projectId?: long(name='ProjectId'),
  shapeDataId?: string(name='ShapeDataId'),
  shapeWkt?: string(name='ShapeWkt'),
}

model CreateAIJobShrinkRequest {
  app?: string(name='App'),
  areaThreshold?: double(name='AreaThreshold'),
  confidence?: double(name='Confidence'),
  inputsShrink?: string(name='Inputs'),
  jobName?: string(name='JobName'),
  modelProjectId?: long(name='ModelProjectId'),
  modelVersion?: string(name='ModelVersion'),
  projectId?: long(name='ProjectId'),
  shapeDataId?: string(name='ShapeDataId'),
  shapeWkt?: string(name='ShapeWkt'),
}

model CreateAIJobResponseBody = {
  app?: string(name='App'),
  jobs?: [ 
    {
      jobId?: long(name='JobId'),
      name?: string(name='Name'),
      success?: boolean(name='Success'),
    }
  ](name='Jobs'),
  projectId?: long(name='ProjectId'),
  requestId?: string(name='RequestId'),
}

model CreateAIJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAIJobResponseBody(name='body'),
}

async function createAIJobWithOptions(tmpReq: CreateAIJobRequest, runtime: Util.RuntimeOptions): CreateAIJobResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAIJobShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.inputs)) {
    request.inputsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.inputs, 'Inputs', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.app)) {
    body['App'] = request.app;
  }
  if (!Util.isUnset(request.areaThreshold)) {
    body['AreaThreshold'] = request.areaThreshold;
  }
  if (!Util.isUnset(request.confidence)) {
    body['Confidence'] = request.confidence;
  }
  if (!Util.isUnset(request.inputsShrink)) {
    body['Inputs'] = request.inputsShrink;
  }
  if (!Util.isUnset(request.jobName)) {
    body['JobName'] = request.jobName;
  }
  if (!Util.isUnset(request.modelProjectId)) {
    body['ModelProjectId'] = request.modelProjectId;
  }
  if (!Util.isUnset(request.modelVersion)) {
    body['ModelVersion'] = request.modelVersion;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.shapeDataId)) {
    body['ShapeDataId'] = request.shapeDataId;
  }
  if (!Util.isUnset(request.shapeWkt)) {
    body['ShapeWkt'] = request.shapeWkt;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateAIJob',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAIJob(request: CreateAIJobRequest): CreateAIJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAIJobWithOptions(request, runtime);
}

model DeleteJobsRequest {
  jobIds?: [ long ](name='JobIds'),
}

model DeleteJobsShrinkRequest {
  jobIdsShrink?: string(name='JobIds'),
}

model DeleteJobsResponseBody = {
  num?: int32(name='Num'),
  requestId?: string(name='RequestId'),
}

model DeleteJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteJobsResponseBody(name='body'),
}

async function deleteJobsWithOptions(tmpReq: DeleteJobsRequest, runtime: Util.RuntimeOptions): DeleteJobsResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteJobs',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteJobs(request: DeleteJobsRequest): DeleteJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteJobsWithOptions(request, runtime);
}

model DeleteUserMapserviceDatasRequest {
  dataIds?: [ string ](name='DataIds'),
}

model DeleteUserMapserviceDatasShrinkRequest {
  dataIdsShrink?: string(name='DataIds'),
}

model DeleteUserMapserviceDatasResponseBody = {
  num?: int32(name='Num'),
  requestId?: string(name='RequestId'),
}

model DeleteUserMapserviceDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteUserMapserviceDatasResponseBody(name='body'),
}

async function deleteUserMapserviceDatasWithOptions(tmpReq: DeleteUserMapserviceDatasRequest, runtime: Util.RuntimeOptions): DeleteUserMapserviceDatasResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteUserMapserviceDatasShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataIds)) {
    request.dataIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataIds, 'DataIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataIdsShrink)) {
    body['DataIds'] = request.dataIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserMapserviceDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserMapserviceDatas(request: DeleteUserMapserviceDatasRequest): DeleteUserMapserviceDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserMapserviceDatasWithOptions(request, runtime);
}

model DeleteUserRasterDatasRequest {
  dataIds?: [ string ](name='DataIds'),
}

model DeleteUserRasterDatasShrinkRequest {
  dataIdsShrink?: string(name='DataIds'),
}

model DeleteUserRasterDatasResponseBody = {
  num?: int32(name='Num'),
  requestId?: string(name='RequestId'),
}

model DeleteUserRasterDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteUserRasterDatasResponseBody(name='body'),
}

async function deleteUserRasterDatasWithOptions(tmpReq: DeleteUserRasterDatasRequest, runtime: Util.RuntimeOptions): DeleteUserRasterDatasResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteUserRasterDatasShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataIds)) {
    request.dataIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataIds, 'DataIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataIdsShrink)) {
    body['DataIds'] = request.dataIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserRasterDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserRasterDatas(request: DeleteUserRasterDatasRequest): DeleteUserRasterDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserRasterDatasWithOptions(request, runtime);
}

model DeleteUserVectorDatasRequest {
  dataIds?: [ string ](name='DataIds'),
}

model DeleteUserVectorDatasShrinkRequest {
  dataIdsShrink?: string(name='DataIds'),
}

model DeleteUserVectorDatasResponseBody = {
  num?: int32(name='Num'),
  requestId?: string(name='RequestId'),
}

model DeleteUserVectorDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteUserVectorDatasResponseBody(name='body'),
}

async function deleteUserVectorDatasWithOptions(tmpReq: DeleteUserVectorDatasRequest, runtime: Util.RuntimeOptions): DeleteUserVectorDatasResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteUserVectorDatasShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataIds)) {
    request.dataIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataIds, 'DataIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataIdsShrink)) {
    body['DataIds'] = request.dataIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserVectorDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserVectorDatas(request: DeleteUserVectorDatasRequest): DeleteUserVectorDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserVectorDatasWithOptions(request, runtime);
}

model DownloadDataRequest {
  bandNo?: string(name='BandNo'),
  compress?: boolean(name='Compress'),
  dataId?: string(name='DataId'),
}

model DownloadDataResponseBody = {
  dataId?: string(name='DataId'),
  downloadUrl?: string(name='DownloadUrl'),
  finished?: boolean(name='Finished'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
}

model DownloadDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DownloadDataResponseBody(name='body'),
}

async function downloadDataWithOptions(request: DownloadDataRequest, runtime: Util.RuntimeOptions): DownloadDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bandNo)) {
    body['BandNo'] = request.bandNo;
  }
  if (!Util.isUnset(request.compress)) {
    body['Compress'] = request.compress;
  }
  if (!Util.isUnset(request.dataId)) {
    body['DataId'] = request.dataId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DownloadData',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function downloadData(request: DownloadDataRequest): DownloadDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return downloadDataWithOptions(request, runtime);
}

model GetJobsRequest {
  appName?: string(name='AppName'),
  jobIds?: [ long ](name='JobIds'),
  jobType?: string(name='JobType'),
  nameLike?: string(name='NameLike'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
}

model GetJobsShrinkRequest {
  appName?: string(name='AppName'),
  jobIdsShrink?: string(name='JobIds'),
  jobType?: string(name='JobType'),
  nameLike?: string(name='NameLike'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
}

model GetJobsResponseBody = {
  list?: [ 
    {
      app?: string(name='App'),
      jobId?: long(name='JobId'),
      jobName?: string(name='JobName'),
      jobOutDataId?: string(name='JobOutDataId'),
      jobType?: int32(name='JobType'),
      outDataId?: long(name='OutDataId'),
      outDataType?: int32(name='OutDataType'),
      outDateType?: int32(name='OutDateType'),
      progress?: string(name='Progress'),
      requestId?: string(name='RequestId'),
      status?: int32(name='Status'),
      submitDate?: long(name='SubmitDate'),
    }
  ](name='List'),
  requestId?: string(name='RequestId'),
}

model GetJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetJobsResponseBody(name='body'),
}

async function getJobsWithOptions(tmpReq: GetJobsRequest, runtime: Util.RuntimeOptions): GetJobsResponse {
  Util.validateModel(tmpReq);
  var request = new GetJobsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.jobIds)) {
    request.jobIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.jobIds, 'JobIds', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.jobIdsShrink)) {
    body['JobIds'] = request.jobIdsShrink;
  }
  if (!Util.isUnset(request.jobType)) {
    body['JobType'] = request.jobType;
  }
  if (!Util.isUnset(request.nameLike)) {
    body['NameLike'] = request.nameLike;
  }
  if (!Util.isUnset(request.pageNo)) {
    body['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetJobs',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJobs(request: GetJobsRequest): GetJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJobsWithOptions(request, runtime);
}

model GetUserTokenRequest {
  forceCreate?: boolean(name='ForceCreate'),
}

model GetUserTokenResponseBody = {
  expiredAt?: long(name='ExpiredAt'),
  requestId?: string(name='RequestId'),
  token?: string(name='Token'),
}

model GetUserTokenResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserTokenResponseBody(name='body'),
}

async function getUserTokenWithOptions(request: GetUserTokenRequest, runtime: Util.RuntimeOptions): GetUserTokenResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.forceCreate)) {
    body['ForceCreate'] = request.forceCreate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetUserToken',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserToken(request: GetUserTokenRequest): GetUserTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserTokenWithOptions(request, runtime);
}

model ListDatasRequest {
  cloudageMax?: int32(name='CloudageMax'),
  cloudageMin?: int32(name='CloudageMin'),
  dateEnd?: string(name='DateEnd'),
  dateStart?: string(name='DateStart'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionWkt?: string(name='RegionWkt'),
  sourceTypeList?: [ string ](name='SourceTypeList'),
}

model ListDatasShrinkRequest {
  cloudageMax?: int32(name='CloudageMax'),
  cloudageMin?: int32(name='CloudageMin'),
  dateEnd?: string(name='DateEnd'),
  dateStart?: string(name='DateStart'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionWkt?: string(name='RegionWkt'),
  sourceTypeListShrink?: string(name='SourceTypeList'),
}

model ListDatasResponseBody = {
  list?: [ 
    {
      dataId?: string(name='DataId'),
      raster?: {
        acquisitionDateEnd?: string(name='AcquisitionDateEnd'),
        acquisitionDateStart?: string(name='AcquisitionDateStart'),
        bands?: [ 
          {
            bandNo?: string(name='BandNo'),
            height?: int32(name='Height'),
            resolution?: double(name='Resolution'),
            width?: int32(name='Width'),
          }
        ](name='Bands'),
        bbox?: [ double ](name='Bbox'),
        cloudCoverage?: int32(name='CloudCoverage'),
        name?: string(name='Name'),
        publishMsg?: string(name='PublishMsg'),
        publishStatus?: string(name='PublishStatus'),
        sourceType?: string(name='SourceType'),
        stacId?: string(name='StacId'),
      }(name='Raster'),
    }
  ](name='List'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDatasResponseBody(name='body'),
}

async function listDatasWithOptions(tmpReq: ListDatasRequest, runtime: Util.RuntimeOptions): ListDatasResponse {
  Util.validateModel(tmpReq);
  var request = new ListDatasShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.sourceTypeList)) {
    request.sourceTypeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sourceTypeList, 'SourceTypeList', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.cloudageMax)) {
    body['CloudageMax'] = request.cloudageMax;
  }
  if (!Util.isUnset(request.cloudageMin)) {
    body['CloudageMin'] = request.cloudageMin;
  }
  if (!Util.isUnset(request.dateEnd)) {
    body['DateEnd'] = request.dateEnd;
  }
  if (!Util.isUnset(request.dateStart)) {
    body['DateStart'] = request.dateStart;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionWkt)) {
    body['RegionWkt'] = request.regionWkt;
  }
  if (!Util.isUnset(request.sourceTypeListShrink)) {
    body['SourceTypeList'] = request.sourceTypeListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDatas(request: ListDatasRequest): ListDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDatasWithOptions(request, runtime);
}

model ListUserMapServiceDatasRequest {
  createDay?: string(name='CreateDay'),
  dataId?: string(name='DataId'),
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListUserMapServiceDatasResponseBody = {
  list?: [ 
    {
      address?: string(name='Address'),
      dataId?: string(name='DataId'),
      mapType?: string(name='MapType'),
      name?: string(name='Name'),
      projectionType?: string(name='ProjectionType'),
      publishMsg?: string(name='PublishMsg'),
      publishStatus?: string(name='PublishStatus'),
      zoomLevelMax?: int32(name='ZoomLevelMax'),
      zoomLevelMin?: int32(name='ZoomLevelMin'),
    }
  ](name='List'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListUserMapServiceDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserMapServiceDatasResponseBody(name='body'),
}

async function listUserMapServiceDatasWithOptions(request: ListUserMapServiceDatasRequest, runtime: Util.RuntimeOptions): ListUserMapServiceDatasResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.createDay)) {
    body['CreateDay'] = request.createDay;
  }
  if (!Util.isUnset(request.dataId)) {
    body['DataId'] = request.dataId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListUserMapServiceDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserMapServiceDatas(request: ListUserMapServiceDatasRequest): ListUserMapServiceDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserMapServiceDatasWithOptions(request, runtime);
}

model ListUserRasterDatasRequest {
  acquisitionDate?: string(name='AcquisitionDate'),
  dataId?: string(name='DataId'),
  fromType?: string(name='FromType'),
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  resolution?: double(name='Resolution'),
  uploadDate?: string(name='UploadDate'),
}

model ListUserRasterDatasResponseBody = {
  list?: [ 
    {
      dataId?: string(name='DataId'),
      raster?: {
        acquisitionDateEnd?: string(name='AcquisitionDateEnd'),
        acquisitionDateStart?: string(name='AcquisitionDateStart'),
        bands?: [ 
          {
            bandNo?: string(name='BandNo'),
            height?: int32(name='Height'),
            resolution?: double(name='Resolution'),
            width?: int32(name='Width'),
          }
        ](name='Bands'),
        bbox?: [ double ](name='Bbox'),
        cloudCoverage?: int32(name='CloudCoverage'),
        name?: string(name='Name'),
        publishMsg?: string(name='PublishMsg'),
        publishStatus?: string(name='PublishStatus'),
        sourceType?: string(name='SourceType'),
        stacId?: string(name='StacId'),
      }(name='Raster'),
    }
  ](name='List'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListUserRasterDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserRasterDatasResponseBody(name='body'),
}

async function listUserRasterDatasWithOptions(request: ListUserRasterDatasRequest, runtime: Util.RuntimeOptions): ListUserRasterDatasResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acquisitionDate)) {
    body['AcquisitionDate'] = request.acquisitionDate;
  }
  if (!Util.isUnset(request.dataId)) {
    body['DataId'] = request.dataId;
  }
  if (!Util.isUnset(request.fromType)) {
    body['FromType'] = request.fromType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resolution)) {
    body['Resolution'] = request.resolution;
  }
  if (!Util.isUnset(request.uploadDate)) {
    body['UploadDate'] = request.uploadDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListUserRasterDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserRasterDatas(request: ListUserRasterDatasRequest): ListUserRasterDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserRasterDatasWithOptions(request, runtime);
}

model ListUserVectorDatasRequest {
  dataId?: string(name='DataId'),
  fromType?: string(name='FromType'),
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  uploadDate?: string(name='UploadDate'),
}

model ListUserVectorDatasResponseBody = {
  list?: [ 
    {
      dataId?: string(name='DataId'),
      vector?: {
        bbox?: [ double ](name='Bbox'),
        name?: string(name='Name'),
        publishMsg?: string(name='PublishMsg'),
        publishStatus?: string(name='PublishStatus'),
        stacId?: string(name='StacId'),
      }(name='Vector'),
    }
  ](name='List'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: long(name='TotalCount'),
}

model ListUserVectorDatasResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUserVectorDatasResponseBody(name='body'),
}

async function listUserVectorDatasWithOptions(request: ListUserVectorDatasRequest, runtime: Util.RuntimeOptions): ListUserVectorDatasResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataId)) {
    body['DataId'] = request.dataId;
  }
  if (!Util.isUnset(request.fromType)) {
    body['FromType'] = request.fromType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.uploadDate)) {
    body['UploadDate'] = request.uploadDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListUserVectorDatas',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUserVectorDatas(request: ListUserVectorDatasRequest): ListUserVectorDatasResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserVectorDatasWithOptions(request, runtime);
}

model PublishMapserviceRequest {
  address?: string(name='Address'),
  name?: string(name='Name'),
  projectionType?: string(name='ProjectionType'),
  zoomLevelMax?: int32(name='ZoomLevelMax'),
  zoomLevelMin?: int32(name='ZoomLevelMin'),
}

model PublishMapserviceResponseBody = {
  dataId?: string(name='DataId'),
  requestId?: string(name='RequestId'),
}

model PublishMapserviceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PublishMapserviceResponseBody(name='body'),
}

async function publishMapserviceWithOptions(request: PublishMapserviceRequest, runtime: Util.RuntimeOptions): PublishMapserviceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.address)) {
    body['Address'] = request.address;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectionType)) {
    body['ProjectionType'] = request.projectionType;
  }
  if (!Util.isUnset(request.zoomLevelMax)) {
    body['ZoomLevelMax'] = request.zoomLevelMax;
  }
  if (!Util.isUnset(request.zoomLevelMin)) {
    body['ZoomLevelMin'] = request.zoomLevelMin;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PublishMapservice',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function publishMapservice(request: PublishMapserviceRequest): PublishMapserviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishMapserviceWithOptions(request, runtime);
}

model PublishRasterRequest {
  acquisitionDate?: string(name='AcquisitionDate'),
  attachDownloadUrl?: string(name='AttachDownloadUrl'),
  attachFileType?: string(name='AttachFileType'),
  downloadUrl?: string(name='DownloadUrl'),
  fileType?: string(name='FileType'),
  name?: string(name='Name'),
}

model PublishRasterResponseBody = {
  dataId?: string(name='DataId'),
  requestId?: string(name='RequestId'),
}

model PublishRasterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PublishRasterResponseBody(name='body'),
}

async function publishRasterWithOptions(request: PublishRasterRequest, runtime: Util.RuntimeOptions): PublishRasterResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.acquisitionDate)) {
    body['AcquisitionDate'] = request.acquisitionDate;
  }
  if (!Util.isUnset(request.attachDownloadUrl)) {
    body['AttachDownloadUrl'] = request.attachDownloadUrl;
  }
  if (!Util.isUnset(request.attachFileType)) {
    body['AttachFileType'] = request.attachFileType;
  }
  if (!Util.isUnset(request.downloadUrl)) {
    body['DownloadUrl'] = request.downloadUrl;
  }
  if (!Util.isUnset(request.fileType)) {
    body['FileType'] = request.fileType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PublishRaster',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function publishRaster(request: PublishRasterRequest): PublishRasterResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishRasterWithOptions(request, runtime);
}

model PublishVectorRequest {
  downloadUrl?: string(name='DownloadUrl'),
  name?: string(name='Name'),
}

model PublishVectorResponseBody = {
  dataId?: string(name='DataId'),
  requestId?: string(name='RequestId'),
}

model PublishVectorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PublishVectorResponseBody(name='body'),
}

async function publishVectorWithOptions(request: PublishVectorRequest, runtime: Util.RuntimeOptions): PublishVectorResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.downloadUrl)) {
    body['DownloadUrl'] = request.downloadUrl;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PublishVector',
    version = '2022-06-09',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function publishVector(request: PublishVectorRequest): PublishVectorResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishVectorWithOptions(request, runtime);
}

